package com.wongoing.webchat.pub.test;

import java.util.Map;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.wongoing.apiclient.weixin.WXPayHelper;
import com.wongoing.sys.service.SysConfigService;
import com.wongoing.test.MyServiceTestCase;
import com.wongoing.util.LogService;

public class WxPayTransferTester extends MyServiceTestCase<SysConfigService>{
	
	@Test
	public void transferTest() {
		try {
			this.service.initAllConfig();
			String partner_trade_no = "TT20180627105601";
			String enc_bank_no = "建设银行";
			String enc_true_name = "吴兆强";
			String bank_code = "1003";
			String amount = "100";
			Map<String,String> result = WXPayHelper.getInstance().weixinTransferResult(partner_trade_no, enc_bank_no, enc_true_name, bank_code, amount, null);
			String return_code = result.get("return_code");
			String result_code = result.get("result_code");
			String err_code = result.get("err_code");
			String payment_no = result.get("payment_no");
			String cmms_amt = result.get("cmms_amt");
			LogService.getInstance(this).info("return_code:"+return_code);
			LogService.getInstance(this).info("result_code:"+result_code);
			LogService.getInstance(this).info("err_code:"+err_code);
			LogService.getInstance(this).info("payment_no:"+payment_no);
			LogService.getInstance(this).info("cmms_amt:"+cmms_amt);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
